<template>
<div class="wrap">
  <div class="container">
    <div class="row">
      <div class="col-xs-12 col-sm-6">
        <div class="row">
          <div class="col-xs-12 col-sm-6">
            <ul class="nav nav-pills nav-stacked my-nav">
              <h4 class="title">分类</h4>
              <li :key="index" v-for="(item, index) in menuList"><a href="javascript:;" @click="thisType($event, item.id)">{{item.name}}</a></li>
            </ul>
          </div>
          <!-- <div class="col-xs-12 col-sm-6">
            <ul class="nav nav-pills nav-stacked my-nav">
              <h4 class="title">信息</h4>
              <li><a href="javascript:;">我们的商店</a></li>
              <li><a href="javascript:;">站点地图</a></li>
              <li><a href="javascript:;">Copyright © 2012-2015 TheColorWheel. All Rights Reserved 颜料块画廊版权所有 粤ICP备16009301号</a></li>
              <a class="qq-img" href="http://shang.qq.com/email/stop/email_stop.html?qq=473838071&sig=0de23d92495f28f5278739d23abd17fcd6569bdc4895b6eb&tttt=1">
                <img border="0" src="http://wpa.qq.com/imgd?IDKEY=f1c95a5ba7f79ea3b095a4e389e131f73755fdf296ab0b62&amp;pic=51" alt="大户家具QQ交流" title="QQ交流">
              </a>
            </ul>
          </div> -->
          <div class="col-xs-12 col-sm-6">
            <div class="my-info my-nav">
              <h4 class="title">信息</h4>
              <div class="e-mail">
                Copyright © 2012-2015 TheColorWheel. All Rights Reserved 大户家具 粤ICP备16009301号
              </div>
              <a target="_blank" ref="linkQQ" href="javascript:;"><img border="0" src="http://wpa.qq.com/imgd?IDKEY=f1c95a5ba7f79ea3b095a4e389e131f73755fdf296ab0b62&amp;pic=51" alt="点击我QQ联系大户家居" title="点击我QQ联系大户家居"></a>
            </div>
          </div>
        </div>
      </div>
      <div class="col-xs-12 col-sm-6">
        <div class="my-info my-nav">
          <h4 class="title">店信息</h4>
          <p>
            <i class="glyphicon glyphicon-map-marker"></i>
            {{detailInfo.addr}}
          </p>
          <div class="phone-call">
            <i class="glyphicon glyphicon-earphone"></i>
            Call us now：
            <span> {{detailInfo.tele}}</span>
          </div>
          <div class="e-mail">
            <i class="glyphicon glyphicon-envelope"></i>
            电子邮件：
            <span> {{detailInfo.email}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</template>

<script>
export default {
  data () {
    return {
      menuList: []
    }
  },
  computed: {
    detailInfo () {
      var info = this.$store.state.info
      this.$nextTick(() => {
        // eslint-disable-next-line
        this.$refs.linkQQ.href = `http://wpa.qq.com/msgrd?v=3&uin=${info.QQ}&site=qq&menu=yes`
      })
      return info
    }
  },
  methods: {
    thisType (el, id) {
      el.target.style.backgroundColor = '#333'
      this.$store.state.meunName = this.menuList.filter((item) => {
        return item.id === id
      })[0].name
      if (this.$route.name !== 'commodityList') {
        this.$router.push({
          path: '/',
          name: 'commodityList',
          meta: {
            id: id
          }
        })
      } else {
        this.$store.state.commodityId = id
      }
    }
  },
  created () {
    this.$http.get('api/column').then((response) => {
      this.menuList = response.data.data
    }).catch((err) => {
      console.log(err)
    })
  }
}
</script>

<style lang="less" scoped>
.wrap{
  width: 100%;
  background-color: #333;
  padding-bottom: 30px;
  li{
    a{
      color: #777777;
      font-weight:bold;
      &:hover{
        color: #fff;
        background-color: #333;
      }
    }
    &.active{
      a{
        background-color: #333;
      }
    }
  }
  .my-info{
    p{
      color: #777777;
      font-weight:bold;
      padding: 0 15px;
      i{
        font-size: 26px;
        width: 32px;
        padding-right: 6px;
      }
    }
    .phone-call{
      color: #777777;
      padding: 15px 15px;
      i{
        font-size: 23px;
        float: left;
        margin-right: 6px;
        margin-top: -5px;
      }
      span{
        color: #fff;
      }
    }
    .e-mail{
      color: #777777;
      padding: 15px 15px;
      i{
        font-size: 23px;
        float: left;
        margin-right: 6px;
        margin-top: -3px;
      }
      span{
        color: #fff;
      }
    }
  }
}
.container{
  margin-top: 50px;
  margin-bottom: 10px;
}
.title{
  font:600 18px/22px "Open Sans",sans-serif;
  color: #fff;
  padding: 10px 15px;
}
.qq-img{
  padding: 10px 15px;
}
</style>
